package com.aspose.cells;

final class zcgb {
   public byte[] a;
   public int b;
   public int c;
   public long d;
   public byte[] e;
   public int f;
   public int g;
   public long h;
   public String i;
   zqv j;
   zaki k;
   int l;
   public long m;
   zaj n = new zaj();

   public int a(boolean var1) {
      return this.a(15, var1);
   }

   public int a(int var1, boolean var2) {
      this.k = new zaki();
      return this.k.a(this, var2 ? -var1 : var1);
   }

   public int a(int var1) {
      return this.k == null ? -2 : this.k.b(this, var1);
   }

   public int a() {
      if (this.k == null) {
         return -2;
      } else {
         int var1 = this.k.b(this);
         this.k = null;
         return var1;
      }
   }

   public int b(int var1, boolean var2) {
      return this.a(var1, 15, var2);
   }

   public int a(int var1, int var2, boolean var3) {
      this.j = new zqv();
      return this.j.a(this, var1, var3 ? -var2 : var2);
   }

   public int b(int var1) {
      return this.j == null ? -2 : this.j.a(this, var1);
   }

   public int b() {
      if (this.j == null) {
         return -2;
      } else {
         int var1 = this.j.j();
         this.j = null;
         return var1;
      }
   }

   void c() {
      int var1 = this.j.f;
      if (var1 > this.g) {
         var1 = this.g;
      }

      if (var1 != 0) {
         if (this.j.c.length > this.j.e && this.e.length > this.f && this.j.c.length >= this.j.e + var1 && this.e.length < this.f + var1) {
            ;
         }

         System.arraycopy(this.j.c, this.j.e, this.e, this.f, var1);
         this.f += var1;
         this.j.e += var1;
         this.h += (long)var1;
         this.g -= var1;
         this.j.f -= var1;
         if (this.j.f == 0) {
            this.j.e = 0;
         }

      }
   }

   int a(byte[] var1, int var2, int var3) {
      int var4 = this.c;
      if (var4 > var3) {
         var4 = var3;
      }

      if (var4 == 0) {
         return 0;
      } else {
         this.c -= var4;
         if (this.j.g == 0) {
            this.m = this.n.a(this.m, this.a, this.b, var4);
         }

         System.arraycopy(this.a, this.b, var1, var2, var4);
         this.b += var4;
         this.d += (long)var4;
         return var4;
      }
   }

   public void d() {
      this.a = null;
      this.e = null;
      this.i = null;
      this.n = null;
   }
}
